package com.aqielife.demo.controller;

import com.aqielife.demo.service.RabbitmqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author aqie
 * @date 2022/02/06 16:51
 * @desc
 */
@RequestMapping("mq")
@RestController
public class RabbitmqController {
  @Autowired
  private RabbitmqService rabbitmqService;

  @PostMapping("/sendWork")
  public void sendWork() {
    rabbitmqService.sendWork();
  }

  @RequestMapping("/sendPublish")
  public String sendPublish() {
    rabbitmqService.sendPublish();
    return "发送成功...";
  }

  @RequestMapping("/sendTopic")
  public String sendTopic() {
    rabbitmqService.sendTopic();
    return "发送成功...";
  }
}
